home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8132 < prev    next >
Encoding:
Text File  |  1996-08-05  |  974 b   |  29 lines

  1. Newsgroups: comp.lang.c
  2. Path: cs.mun.ca!sjt
  3. From: sjt@cs.mun.ca (Stephen J. Tremblett)
  4. Subject: Re: String Arrays and string parsing
  5. Message-ID: <1996Mar1.184726.16618@cs.mun.ca>
  6. Sender: usenet@cs.mun.ca (NNTP server account)
  7. Organization: CS Dept., Memorial University of Newfoundland
  8. X-Newsreader: TIN [version 1.2 PL2]
  9. References: <31287278.789445@news.inforamp.net> <4gaqrj$3kn@hacgate2.hac.com> <824846500snz@genesis.demon.co.uk>
  10. Date: Fri, 1 Mar 1996 18:47:26 GMT
  11.  
  12.  
  13. How about using strtok()?  It will find your specified delimiters in a
  14. string and break the string into a group of array elements.
  15. ex : buffer = "07/29/1973"
  16. Using "/" as our delimiter, we get date[0] = "07", date[1] = "29",
  17. date[2] = "1973".
  18.  
  19. I'd post the function where I actually used strtok(), but I can't seem to
  20. find it right now...
  21.  
  22. Steve T.
  23.  
  24. -- 
  25. I am far to young to feel so old
  26. And far too tired to care
  27. But I took down twenty bastards before they left me lying there
  28.  - The Lowest of the Low
  29.